package com.th.cash.th2.splash

import android.content.Context
import com.lxj.xpopup.core.CenterPopupView
import com.th.resmodel.R
import com.th.resmodel.databinding.PopupDisclosureBinding

class DisclosurePopup(context: Context) : CenterPopupView(context) {

    var clickListener: ((Boolean) -> Unit)? = null

    override fun getImplLayoutId(): Int {
        return R.layout.popup_disclosure
    }

    override fun onCreate() {
        super.onCreate()

        val bind = PopupDisclosureBinding.bind(popupImplView)

        bind.run {
            tvSubmit1.setOnClickListener {
                dismiss()
                clickListener?.invoke(false)
            }

            tvSubmit2.setOnClickListener {
                dismiss()
                clickListener?.invoke(true)
            }

        }

    }
}